<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Lwt.html">
<link rel="next" href="Lwt_condition.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Lwt" rel="Chapter" href="Lwt.html">
<link title="Lwt_chan" rel="Chapter" href="Lwt_chan.html">
<link title="Lwt_condition" rel="Chapter" href="Lwt_condition.html">
<link title="Lwt_equeue" rel="Chapter" href="Lwt_equeue.html">
<link title="Lwt_lib" rel="Chapter" href="Lwt_lib.html">
<link title="Lwt_mutex" rel="Chapter" href="Lwt_mutex.html">
<link title="Lwt_pool" rel="Chapter" href="Lwt_pool.html">
<link title="Lwt_pqueue" rel="Chapter" href="Lwt_pqueue.html">
<link title="Lwt_preemptive" rel="Chapter" href="Lwt_preemptive.html">
<link title="Lwt_queue" rel="Chapter" href="Lwt_queue.html">
<link title="Lwt_ssl" rel="Chapter" href="Lwt_ssl.html">
<link title="Lwt_timeout" rel="Chapter" href="Lwt_timeout.html">
<link title="Lwt_unix" rel="Chapter" href="Lwt_unix.html">
<link title="Lwt_util" rel="Chapter" href="Lwt_util.html">
<link title="Orpc" rel="Chapter" href="Orpc.html">
<link title="Orpc_js_client" rel="Chapter" href="Orpc_js_client.html">
<link title="Orpc_js_server" rel="Chapter" href="Orpc_js_server.html">
<link title="Orpc_onc" rel="Chapter" href="Orpc_onc.html">
<link title="Orpc_pp" rel="Chapter" href="Orpc_pp.html">
<link title="Pqueue" rel="Chapter" href="Pqueue.html"><link title="Cooperative output channels" rel="Section" href="#2_Cooperativeoutputchannels">
<title>Lwt_chan</title>
</head>
<body>
<div class="navbar"><a href="Lwt.html">Previous</a>
&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="Lwt_condition.html">Next</a>
</div>
<center><h1>Module <a href="type_Lwt_chan.html">Lwt_chan</a></h1></center>
<br>
<pre><span class="keyword">module</span> Lwt_chan: <code class="code">sig</code> <a href="Lwt_chan.html">..</a> <code class="code">end</code></pre>Module <code class="code">Lwt_chan</code>: cooperative, <code class="code">Pervasives</code>-like, I/O functions<br>
<hr width="100%">
<pre><span class="keyword">type</span> <a name="TYPEin_channel"></a><code class="type"></code>in_channel </pre>
<div class="info">
<a name="2_Cooperativeinputchannels"></a>
<h2>Cooperative input channels</h2><br>
</div>

<pre><span class="keyword">val</span> <a name="VALin_channel_of_descr"></a>in_channel_of_descr : <code class="type"><a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -> <a href="Lwt_chan.html#TYPEin_channel">in_channel</a></code></pre><pre><span class="keyword">val</span> <a name="VALmake_in_channel"></a>make_in_channel : <code class="type">?close:(unit -> unit <a href="Lwt.html#TYPEt">Lwt.t</a>) -><br>       (string -> int -> int -> int <a href="Lwt.html#TYPEt">Lwt.t</a>) -> <a href="Lwt_chan.html#TYPEin_channel">in_channel</a></code></pre><div class="info">
<code class="code">make_in_channel read</code> creates an input channel from the <code class="code">read</code>
    function. <code class="code">read s ofs len</code> should (cooperatively) read <code class="code">len</code> bytes from
    the source, and put them in <code class="code">s</code>, at offset <code class="code">ofs</code>, and return the number
    of bytes effectively read. If provided, <code class="code">close</code> will be called by
    <code class="code">close_in</code>. By default, <code class="code">close_in</code> does not do anything.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALinput_line"></a>input_line : <code class="type"><a href="Lwt_chan.html#TYPEin_channel">in_channel</a> -> string <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALinput_value"></a>input_value : <code class="type"><a href="Lwt_chan.html#TYPEin_channel">in_channel</a> -> 'a <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALinput"></a>input : <code class="type"><a href="Lwt_chan.html#TYPEin_channel">in_channel</a> -> string -> int -> int -> int <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALreally_input"></a>really_input : <code class="type"><a href="Lwt_chan.html#TYPEin_channel">in_channel</a> -> string -> int -> int -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALinput_char"></a>input_char : <code class="type"><a href="Lwt_chan.html#TYPEin_channel">in_channel</a> -> char <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALinput_binary_int"></a>input_binary_int : <code class="type"><a href="Lwt_chan.html#TYPEin_channel">in_channel</a> -> int <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALopen_in_gen"></a>open_in_gen : <code class="type">Unix.open_flag list -> int -> string -> <a href="Lwt_chan.html#TYPEin_channel">in_channel</a></code></pre><pre><span class="keyword">val</span> <a name="VALopen_in"></a>open_in : <code class="type">string -> <a href="Lwt_chan.html#TYPEin_channel">in_channel</a></code></pre><pre><span class="keyword">val</span> <a name="VALclose_in"></a>close_in : <code class="type"><a href="Lwt_chan.html#TYPEin_channel">in_channel</a> -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><br>
<a name="2_Cooperativeoutputchannels"></a>
<h2>Cooperative output channels</h2><br>
<pre><span class="keyword">type</span> <a name="TYPEout_channel"></a><code class="type"></code>out_channel </pre>

<pre><span class="keyword">val</span> <a name="VALout_channel_of_descr"></a>out_channel_of_descr : <code class="type"><a href="Lwt_unix.html#TYPEfile_descr">Lwt_unix.file_descr</a> -> <a href="Lwt_chan.html#TYPEout_channel">out_channel</a></code></pre><pre><span class="keyword">val</span> <a name="VALmake_out_channel"></a>make_out_channel : <code class="type">?close:(unit -> unit <a href="Lwt.html#TYPEt">Lwt.t</a>) -><br>       (string -> int -> int -> int <a href="Lwt.html#TYPEt">Lwt.t</a>) -> <a href="Lwt_chan.html#TYPEout_channel">out_channel</a></code></pre><div class="info">
<code class="code">make_out_channel write</code> creates an output channel from the <code class="code">write</code>
    function. <code class="code">write s ofs len</code> should (cooperatively) write <code class="code">len</code> bytes from
    <code class="code">s</code>, starting at offset <code class="code">ofs</code>, to the backend, and return the number of
    bytes effectively written. If provided, <code class="code">close</code> will be called by
    <code class="code">close_out</code>. By default, <code class="code">close_out</code> does not do anything.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALoutput"></a>output : <code class="type"><a href="Lwt_chan.html#TYPEout_channel">out_channel</a> -> string -> int -> int -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALflush"></a>flush : <code class="type"><a href="Lwt_chan.html#TYPEout_channel">out_channel</a> -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALoutput_string"></a>output_string : <code class="type"><a href="Lwt_chan.html#TYPEout_channel">out_channel</a> -> string -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALoutput_value"></a>output_value : <code class="type"><a href="Lwt_chan.html#TYPEout_channel">out_channel</a> -> 'a -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALoutput_char"></a>output_char : <code class="type"><a href="Lwt_chan.html#TYPEout_channel">out_channel</a> -> char -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALoutput_binary_int"></a>output_binary_int : <code class="type"><a href="Lwt_chan.html#TYPEout_channel">out_channel</a> -> int -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALopen_out_gen"></a>open_out_gen : <code class="type">Unix.open_flag list -> int -> string -> <a href="Lwt_chan.html#TYPEout_channel">out_channel</a></code></pre><pre><span class="keyword">val</span> <a name="VALopen_out"></a>open_out : <code class="type">string -> <a href="Lwt_chan.html#TYPEout_channel">out_channel</a></code></pre><pre><span class="keyword">val</span> <a name="VALclose_out"></a>close_out : <code class="type"><a href="Lwt_chan.html#TYPEout_channel">out_channel</a> -> unit <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><pre><span class="keyword">val</span> <a name="VALopen_connection"></a>open_connection : <code class="type">Unix.sockaddr -> (<a href="Lwt_chan.html#TYPEin_channel">in_channel</a> * <a href="Lwt_chan.html#TYPEout_channel">out_channel</a>) <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre></body></html>